package com.wanxi.hashmap;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class StudentHashMapTest {
    public static void main(String[] args) {
        Map<Student, String> map = new HashMap<>();
        map.put(new Student("张三", 11), "成都");
        Student student = new Student("李四", 13);
        map.put(student, "上海");
        map.put(new Student("王五2", 44), "北京");
        map.put(new Student("王五1", 44), "北京");
        Set<Student> students = map.keySet();
        for (Student s : students
        ) {
            System.out.println("name=" + s.getName()+"age="+s.getAge() + "   value=" + map.get(s));
        }

    }
}
